    -- // recording the initial positions of all components of the hexapod
    botBodyParts = { 'hexapod', 'hexa_body', 'hexa_base', 'hexa_footTarget', 'hexa_footTarget#0', 'hexa_footTarget#1', 'hexa_footTarget#2', 'hexa_footTarget#3', 'hexa_footTarget#4', 'hexa_joint1', 'hexa_joint1#0', 'hexa_joint1#1', 'hexa_joint1#2', 'hexa_joint1#3', 'hexa_joint1#4' }
    botPositionInitial = {}
    for i,v in pairs(botBodyParts) do    -- (here i and v are variables which will take on the index and value of array-pairs respectively)
        botPositionInitial[v] = simGetObjectPosition(simGetObjectHandle(v), -1)
    end


    -- // reset bot to its initial position
    -- // code taken from: http://www.forum.coppeliarobotics.com/viewtopic.php?f=9&t=685
    -- // apparently simSetObjectPosition() itself does not implicitly/sufficiently call simResetDynamicObject() for all the children
    t={simGetObjectHandle('hexapod')}
    while (#t~=0) do
       h=t[1]
       simResetDynamicObject(h)
       table.remove(t,1)
       ind=0
       child=simGetObjectChild(h,ind)
       while (child~=-1) do
          table.insert(t,child)
          ind=ind+1
          child=simGetObjectChild(h,ind)
       end
    end
    simSetObjectPosition(simGetObjectHandle('hexapod'), -1, botPositionInitial['hexapod'])